# 类和实例
class People(object):  # 紧接着的(object)，表示该类是从哪个类继承下来的
    pass


pe = People()
pe.name = 'Jack'
pe.age = 20
print(pe.name)
print(pe.age)


class Student(object):
    def __init__(self, name, age, score=0):  # 初始化
        self.name = name
        self.age = age
        self.score = score

    def get_info(self):  # 方法封装
        return '%s is %d and score %.2f' % (self.name, int(self.age), float(self.score))

    def get_grade(self):  # 方法封装
        if self.score >= 90:
            return '%s is a good student!' % self.name
        elif 60 <= self.score < 90:
            return 'The score %.2f is ok!' % float(self.score)
        else:
            return 'U are not a good student!'


st = Student('Tom', 12, 66)
print(st.get_info())
print(st.get_grade())

